package lt.marsrutai.mobile.android.model.enums;

public enum SegmentType {
    RIDE("ride"), WALK("walk");

    private String value;

    SegmentType(String value) {
        this.value = value;
    }

    public static SegmentType parseEnum(String string) {
        for (SegmentType segmentType: values()) {
            if (segmentType.toString().equals(string)) {
                return segmentType;
            }
        }

        throw new IllegalArgumentException("Cannot parse enum SegmentType from " + string);
    }

    @Override
    public String toString() {
        return value;
    }
}
